﻿<%@ Page Title="CUPS Manage Users" Language="vb" AutoEventWireup="false" MasterPageFile="~/Content/Site.Master" CodeBehind="users.aspx.vb" Inherits="CupsApp.Web.Form.users" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register assembly="wwDataBinder" namespace="MsdnMag.Web.Controls" tagprefix="ww" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="tabs">
 <div class="tabSelected"><asp:LinkButton ID="lnkUsers" Text = "Users"  runat="server" Enabled = "false"  >
 </asp:LinkButton></div> 
 <div class="tab"><a href ="manage_clients.aspx">Clients</a>  </div>
 <div class="tab"><asp:LinkButton ID="lnkReports" Text = "Reports" runat="server" 
         CausesValidation="False"></asp:LinkButton></div> 
</div>

<div class="Content">
<div class="filler"></div>
   <div class="FullRow1">
     <div class="filler"></div>
     <div class="FormHeading">
        <center> <strong><asp:Label ID="lblBasicInfo" runat="server" Text="NEW USER"></asp:Label></strong></center>
    </div>
  </div> 
  <div class="filler"></div>
  <div class="FullRow1">
        <center> <strong><asp:Label ID="lvlMsg" runat="server" ForeColor="Red" ></asp:Label></strong></center>
    </div> 
   <div class="FullRow1">
       <div class="ContentRow2">
       </div>
       <div class="ContentRow1">
           <asp:Label ID="Label4" runat="server" Text="Username:"></asp:Label>
       </div>
       <div class="ContentRow2">
           <asp:TextBox ID="txtUsername" runat="server" Width="100%"></asp:TextBox>
       </div>
       <div class="ContentRow2">
           <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="* Name is Required"
               ControlToValidate="txtUsername"></asp:RequiredFieldValidator>
       </div>
   </div>
   <div class="FullRow1">
       <div class="ContentRow2">
       </div>
       <div class="ContentRow1">
           <asp:Label ID="Label1" runat="server" Width="100%" Text="Password:"></asp:Label>
       </div>
       <div class="ContentRow2">
           <asp:TextBox ID="txtPassword" TextMode="Password" Width="100%" runat="server"></asp:TextBox>
       </div>
       <div class="ContentRow2">
           <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="* Password is Required"
               ControlToValidate="txtPassword"></asp:RequiredFieldValidator>
       </div>
   </div>
    <div class="ContentRow2">
    </div>
    <div class="ContentRow1">
        <asp:Label ID="Label2" runat="server" Text="Confirm Password:"></asp:Label>
    </div>
    <div class="ContentRow2">
        <asp:TextBox ID="txtConfirmPassword" TextMode="Password" Width="100%" runat="server"></asp:TextBox>
    </div>
    <div class="ContentRow2">
        <asp:CompareValidator ID="CompareValidator" ControlToCompare="txtPassword" ControlToValidate="txtConfirmPassword"
            ValueToCompare="Text" runat="server" ErrorMessage="* Password must match" />
    </div>
   <div class="FullRow1">
    <div class="ContentRow2">
    </div>
    <div class="ContentRow1">
        
    </div>
    <div class="ContentRow2"><asp:Button ID="btnCreateUser" runat="server" Text="Create User" /> </div>
   </div>
   <div class="FullRow1"></div>
    <br />


  <div class="FullRow1">
     <div class="FormHeading">
           <strong><center> <asp:Label ID="lblFirstLanguage" runat="server" Text="EXISTING USERS"></asp:Label></center></strong>
    </div>
  </div> 
   
  <div class="FullRow2"> 
  
      <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
          AutoGenerateColumns="False" DataSourceID="ObjectDataSource1" Width="900px" 
          AutoGenerateDeleteButton="True" DataKeyNames="UserName">
          <Columns>
              <asp:BoundField DataField="UserName" HeaderText="UserName" ReadOnly="True" 
                  SortExpression="UserName" />
                  <asp:TemplateField ShowHeader="False">
                  <ItemTemplate>
                      <asp:LinkButton ID="btnAdmin" runat="server" CausesValidation="false" 
                          CommandName="Make Admin" Text="Make Admin" CommandArgument='<%# Eval("UserName") %>'></asp:LinkButton>
                  </ItemTemplate>
              </asp:TemplateField>
              
              <asp:BoundField DataField="LastActivityDate" HeaderText="Last Activity Date"  HeaderStyle-HorizontalAlign ="Center" 
                  SortExpression="LastActivityDate" >
                  
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
              </asp:BoundField>
                  
              <asp:TemplateField ShowHeader="False">
                  <ItemTemplate>
                      <asp:LinkButton ID="btnUnlock" runat="server" CausesValidation="false" 
                          CommandName="Unlock" Text="Unlock" CommandArgument='<%# Eval("UserName") %>'></asp:LinkButton>
                  </ItemTemplate>
              </asp:TemplateField>
             
              
              <asp:CheckBoxField DataField="IsLockedOut" HeaderText="Locked" 
                  SortExpression="IsLockedOut" />
              <asp:TemplateField ShowHeader="False">
                  <ItemTemplate>
                      <asp:LinkButton ID="btnResetPassword" runat="server" CausesValidation="false" 
                          CommandName="Reset Password" Text="Reset Password" CommandArgument='<%# Eval("UserName") %>'></asp:LinkButton>
                  </ItemTemplate>
              </asp:TemplateField>
              
              <asp:CheckBoxField DataField="IsOnline" HeaderText="Online" 
                  SortExpression="IsOnline" />
              
          </Columns>
      </asp:GridView>
  
  </div>

     
         <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
             SelectMethod="GetAllUsers" TypeName="CupsApp.Service.CupsDomainService" 
             DeleteMethod="DeleteUser">
             <SelectParameters>
                 <asp:Parameter Name="maximumRows" Type="Int32" />
                 <asp:Parameter Name="startRowIndex" Type="Int32" />
             </SelectParameters>
         </asp:ObjectDataSource>

    
  <br />

</div>
   

</asp:Content>
